<%var jstpl = {%>
<script>
	var app = new Vue({
		el: "#gexin_body",
		data: {
			msg: "Test"
		},
		method: {

		}
	})

	var form = layui.form;
	form.verify({
		repass: function(value, item) {
			if($("#password").val() != value) {
				return "两次密码不一致";
			}
		}
	})
	//监听提交
	form.on('submit(formDemo)', function(data) {
		//layer.msg(JSON.stringify(data.field));
		Ajax('/system/role/user/update_pass', data.field, function(d) {
			if(d.state) {
				$('#passwordForm')[0].reset()
			} else {
				layer.msg(d.msg);
			}
		})
	});
</script>
<%};%>

<%var csstpl = {%>

<%};%>
<%layout("../layout/_layout_layui.html",{title:'密码修改',jstpl:jstpl,csstpl:csstpl}){ %>
<form id="passwordForm" method="post">
	<input type="hidden" value="${user.id!}" id="UserId">
	<div class="layui-form" lay-filter="">
		<div class="layui-form-item">
			<label class="layui-form-label">当前密码</label>
			<div class="layui-input-inline">
				<input type="password" name="oldPassword" lay-verType="tips" lay-verify="required" placeholder="请输入当前密码" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">新密码</label>
			<div class="layui-input-inline">
				<input type="password" name="password" id="password" placeholder="请输入新密码" lay-verify="required" autocomplete="off" class="layui-input">
			</div>
			<div class="layui-form-mid layui-word-aux">6到16个字符</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">确认新密码</label>
			<div class="layui-input-inline">
				<input type="password" name="repassword" id="repassword" placeholder="请再次输入新密码" lay-verify="required|repass" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button type="button" class="layui-btn" lay-submit lay-filter="formDemo" id="querenBtn">确认修改</button>
			</div>
		</div>
	</div>
</form>
<%}%>